#include "shapefactory.h"

ShapeFactory::ShapeFactory(QObject* parent)
{
}

ShapeFactory::~ShapeFactory()
{
}

Shape* ShapeFactory::createShape(Canvas::DrawFlag drawFlag)
{
	switch (drawFlag)
	{
	case Canvas::DrawFlag::LineDrawFlag:
		return new Line;
	case Canvas::DrawFlag::CircleDrawFlag:
		return new Circle;
	case Canvas::DrawFlag::RectDrawFlag:
		return new Rect;
	case Canvas::DrawFlag::PentagonDrawFlag:
		return new Pentagon;
	case Canvas::DrawFlag::HexagonDrawFlag:
		return new Hexagon;
	case Canvas::DrawFlag::PentagramDrawFlag:
		return new Pentagram;
	default:
		break;
	}
	return Q_NULLPTR;
}